package com.leruan.aasimp.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.leruan.aasimp.bean.UsedCarBuyMainBean;
import com.leruan.aasimp.bean.UsedCarSaleMainBean;
import com.leruan.aasimp.dao.CarSaleImageDao;
import com.leruan.aasimp.dao.UsedCarBuyDao;
import com.leruan.aasimp.dao.UsedCarSaleDao;
import com.leruan.aasimp.entity.CarSaleImage;
import com.leruan.aasimp.entity.UsedCarBuy;
import com.leruan.aasimp.entity.UsedCarSale;
import com.leruan.aasimp.service.UsedCarService;

public class UsedCarServiceImpl implements UsedCarService {

	@Resource
	private UsedCarSaleDao usedCarSaleDao;
	@Resource
	private UsedCarBuyDao usedCarBuyDao;
	@Resource
	private CarSaleImageDao carSaleImageDao;
	
	public List<UsedCarSaleMainBean> getUsedCarSaleList(
			Map<String, Object> map, int pageNo) throws Exception {
		return usedCarSaleDao.getUsedCarSaleList(map, pageNo);
	}

	public Long getUsedSaleTotal(Map<String, Object> map) throws Exception {
		return usedCarSaleDao.getUsedSaleTotal(map);
	}

	public UsedCarSale getSaleInfoById(String id) throws Exception {
		return usedCarSaleDao.getSaleInfoById(id);
	}

	public List<UsedCarBuyMainBean> getUsedCarBuyList(Map<String, Object> map,
			int pageNo) throws Exception {
		return usedCarBuyDao.getUsedCarBuyList(map, pageNo);
	}

	public Long getUsedBuyTotal(Map<String, Object> map) throws Exception {
		return usedCarBuyDao.getUsedBuyTotal(map);
	}

	public UsedCarBuy getUsedCarBuyById(String id) throws Exception {
		return usedCarBuyDao.getUsedCarBuyById(id);
	}

	public UsedCarSale getUsedCarSaleById(String id) throws Exception {
		return usedCarSaleDao.getSaleInfoById(id);
	}

	public List<String> getImagesUrlById(String id) throws Exception {
		return usedCarSaleDao.getImagesUrlById(id);
	}

	public void updateUsedCarSale(UsedCarSale usedCarSale) throws Exception {
		usedCarSaleDao.updateUsedCarSale(usedCarSale);
	}

	public List<UsedCarSaleMainBean> getUsedCarSaleListById(String userId)
			throws Exception {
		return usedCarSaleDao.getUsedCarSaleListById(userId);
	}

	public void setUsedCarSaleDao(UsedCarSaleDao usedCarSaleDao) {
		this.usedCarSaleDao = usedCarSaleDao;
	}

	public void setUsedCarBuyDao(UsedCarBuyDao usedCarBuyDao) {
		this.usedCarBuyDao = usedCarBuyDao;
	}

	public List<UsedCarBuyMainBean> getUsedCarBuyListById(String userId)
			throws Exception {
		return usedCarBuyDao.getUsedCarBuyListById(userId);
	}

	public void deleteMyUsedCarSale(String id, String userId) throws Exception {
		usedCarSaleDao.deleteMyUsedCarSale(id, userId);
	}

	public void deleteMyUsedCarBuy(String id, String userId) throws Exception {
		usedCarBuyDao.deleteMyUsedCarBuy(id, userId);
	}

	public void saveUsedCarBuy(Map<String, String> map) throws Exception {
		usedCarBuyDao.saveUsedCarBuy(map);
	}

	public void saveUsedCarSale(UsedCarSale usedCarSale) throws Exception {
		usedCarSaleDao.saveUsedCarSale(usedCarSale);
	}

	public Long findId(UsedCarSale usedCarSale) throws Exception {
		return usedCarSaleDao.findId(usedCarSale);
	}

	public void saveImage(CarSaleImage carSaleImage) throws Exception {
		carSaleImageDao.save(carSaleImage);
	}

	public void setCarSaleImageDao(CarSaleImageDao carSaleImageDao) {
		this.carSaleImageDao = carSaleImageDao;
	}

	public void updateUsedCarBuy(UsedCarBuy usedCarBuy) {
		usedCarBuyDao.updateUsedCarBuy(usedCarBuy);
	}

}
